package com.common.retrofit.methods;

import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.entity.bean.MineBean;
import com.common.retrofit.entity.bean.UserBean;
import com.common.retrofit.service.HaiNingService;

import rx.Observable;
import rx.Subscriber;

public class MineMethods extends BaseMethods {

    private static MineMethods m_ins = null;

    public static MineMethods getInstance() {
        if (m_ins == null) {
            synchronized (MineMethods.class) {
                if (m_ins == null) {
                    m_ins = new MineMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "Personal/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }


    public void index(Subscriber<MineBean> subscriber,
                      int uid ,
                      String hashid   ) {
        Observable observable = initService().myinfo(System.currentTimeMillis()+"",
                "e785f07736bde4d62b77d03214d29647",uid,hashid
        );
        toSubscribe(observable, subscriber);
    }
}
